import sys

import gtk
import webkit

class Window(gtk.Window):

    def __init__(self, web_server):
        gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
        
        self.set_title("Dye Hard - Paintball scoreboard - version 0.0.1") 
        
        self.web_server = web_server

        self.editor = webkit.WebView()
        self.editor.open("http://127.0.0.1:8080/")
        self.add(self.editor)

        self.connect("destroy", self.close)
        self.show_all()

    def close(self, event):
        if self.web_server: self.web_server.stop()
        gtk.main_quit()
